5445c42ffea4bb054a436504b3c3f645fa363f66,jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/DeflateFrameExtension.java,DeflateFrameExtension,incomingFrame,#Frame#,62

Before Change


                }
                if (len > 0)
                {
                    out.setPayload(ByteBuffer.wrap(outbuf,0,len));
                }
                nextIncomingFrame(out);
            }
            catch (DataFormatException e)
            {

After Change


        int maxSize = Math.max(getPolicy().getMaxTextMessageSize(),getPolicy().getMaxBinaryMessageBufferSize());
        ByteAccumulator accumulator = new ByteAccumulator(maxSize);

        DataFrame out = new DataFrame(frame);
        out.setRsv1(false); // Unset RSV1

        // Perform decompression
        while (decompressor.getRemaining() > 0 && !decompressor.finished())
        {
            byte outbuf[] = new byte[Math.min(inlen * 2,bufferSize)];
            try
            {
                int len = decompressor.inflate(outbuf);
                if (len == 0)
                {
                    if (decompressor.needsInput())
                    {
                        throw new BadPayloadException("Unable to inflate frame, not enough input on frame");
                    }
                    if (decompressor.needsDictionary())
                    {
                        throw new BadPayloadException("Unable to inflate frame, frame erroneously says it needs a dictionary");
                    }
                }
                if (len > 0)
                {
                    accumulator.addBuffer(outbuf,0,len);
                }
            }
            catch (DataFormatException e)
            {
                LOG.warn(e);
                throw new BadPayloadException(e);
            }
        }

        // Forward on the frame
        out.setPayload(accumulator.getByteBuffer(getBufferPool()));
        nextIncomingFrame(out);
    }

    /**